//
//  MyCell.m
//  
//
//  Created by 郭明皓 on 15/10/31.
//
//

#import "MyCell.h"
#import "DKNightVersion.h"
@implementation MyCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)dealloc
{
    [_leftLabel release];
    [_rightImage release];
    [super dealloc];
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if ( self) {
        [self create];
    }
    return  self;
}
- (void)create
{
    [DKNightVersionManager addClassToSet:self.class];
    self.nightBackgroundColor = UIColorFromRGB(0x343434);
    self.leftLabel = [[UILabel alloc]init];
    [self.contentView addSubview: self.leftLabel];
    [_leftLabel release];
    self.leftLabel.textColor = [UIColor darkGrayColor];
    self.leftLabel.lineBreakMode = NSLineBreakByCharWrapping;
    
    
    self.rightImage = [[UIImageView alloc]init];
    [self.contentView addSubview:self.rightImage];
    [_rightImage release];
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.leftLabel.frame = CGRectMake(10, 0, self.contentView.frame.size.width / 2, self.contentView.frame.size.height);
    self.rightImage.frame = CGRectMake(self.contentView.frame.size.width - 40, 15, 25, self.contentView.frame.size.height - 30);
}
@end
